package T4.EjemplosDelSwing.ejemplosgui;

import java.awt.*;
import javax.swing.*;


class Frame8 extends JFrame {
   
    public  Frame8() {
        setSize(400,250);
       Container container = this.getContentPane();
        container.setLayout(new BorderLayout(2,2)); 

       String[] borderConsts = { BorderLayout.NORTH,
                                 BorderLayout.SOUTH,
                                 BorderLayout.EAST,
                                 BorderLayout.WEST,
                                 BorderLayout.CENTER };

       String[] buttonNames = { "North Button", "South Button",
                                "East Button", "West Button",
                                "Center Button" };

       for (int i=0; i<borderConsts.length; i++) {
          JButton button = new JButton(buttonNames[i]); 
          container.add(button, borderConsts[i]);
       }
    }
}

public class Ejemplo8{
    public static void main (String[] args){
        Frame8 frame = new Frame8();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
    }
}
